package com.design.birdge.message;


/**
 * 消息类型
 */
public abstract class AbstractMessage {

    /**
     * 持有消息的发送方式引用
     */
    protected MessageImplementor implementor;

    /**
     * 构造方式，构造消息时指定发送方式
     *
     * @param implementor
     */
    public AbstractMessage(MessageImplementor implementor) {
        this.implementor = implementor;
    }

    public void sendMessage(String message, String toUser) {
        this.implementor.send(message, toUser);
    }
}
